<?php
/**
 *
 */
namespace app\home\controller\order;

use app\home\controller\Base;

class Api extends Base
{

	/**
	 * 我的订单列表
	 * @return [type] [description]
	 */
	public function order(){
        $params = $this->request->param();
        $start = !empty($this->request->param('start'))?$this->request->param('start'):'';
        $end = !empty($this->request->param('end'))?$this->request->param('end'):'';
        $where['uid'] =  UID;
        if(!empty($start) && !empty($end)){
            $where['create_time'] = ['between',[$start,$end]];
        }
		$data = model('Order')->getPageDatas($where,$params['page'],$params['limit'],'id,order_id,uid,amount,status,create_time,des,credit');
        $data['code'] = 1;
		return json($data);
	}

    /**
     * [goods 订单详情]
     * @return [type]      [description]
     */
	public function orderDetails(){
		$params = $this->request->param();
		$data = model('Order')->getOneDatas(['order_id'=>$params['order_id']]);
        $data['code'] = 1;
		return json($data);
	}

}